package com.lihaozhe.controller;

import org.springframework.security.access.annotation.Secured;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author 李昊哲
 * @version 1.0
 * 2021/12/1 上午11:45
 */
@Controller
@RequestMapping("/admin")
public class AdminController {
    @Secured("ROLE_admin")
    // @PreAuthorize("hasAnyRole('admin','emp')")
    @GetMapping("/toAdmin")
    public String toAdmin() {
        return "admin";
    }
}